package com.sscl.easyble.variable

import android.bluetooth.BluetoothGatt
import com.sscl.easyble.interfaces.connections.OnBleConnectStateChangedListener
import com.sscl.easyble.interfaces.connections.OnCharacteristicDataOptionsListener
import com.sscl.easyble.interfaces.connections.OnDescriptorDataOptionListener
import com.sscl.easyble.interfaces.connections.OnMtuChangedListener
import com.sscl.easyble.interfaces.connections.OnPhyOptionsListener
import com.sscl.easyble.interfaces.connections.OnReadRemoteRssiListener
import com.sscl.easyble.interfaces.connections.OnReliableWriteCompletedListener
import java.util.concurrent.ScheduledThreadPoolExecutor
import java.util.concurrent.TimeUnit

internal object GlobalConnectVariable {

    internal const val CONNECT_TIME_OUT = 10000L

    internal val connectTimeOutUnit = TimeUnit.MILLISECONDS

    internal val gattList = hashMapOf<String, BluetoothGatt>()

    internal val bluetoothGattConnectStateChangedListenerList =
        hashMapOf<String, OnBleConnectStateChangedListener?>()

    internal val connectTimeOutTimerList = hashMapOf<String, ScheduledThreadPoolExecutor>()

    internal val connectedStateList = hashMapOf<String, Boolean>()

    internal val onDescriptorDataOptionListenerList =
        hashMapOf<String, OnDescriptorDataOptionListener>()

    internal val onCharacteristicDataOptionsListenerList =
        hashMapOf<String, OnCharacteristicDataOptionsListener>()

    internal val writeLargeDataContinueFlagList = hashMapOf<String, Boolean>()

    internal val writeLargeDataKeepList = hashMapOf<String, Boolean>()

    internal val onReadRemoteRssiListenerList = hashMapOf<String, OnReadRemoteRssiListener>()

    internal val onMtuChangedListenerList = hashMapOf<String, OnMtuChangedListener>()

    internal val onPhyOptionsListenerList = hashMapOf<String, OnPhyOptionsListener>()

    internal val onReliableWriteCompletedListenerList = hashMapOf<String, OnReliableWriteCompletedListener>()
}